import { get, post, postWithQuery, upload } from '@/utils/Fetch'
enum API {
    // 20分钟循环发送 序列号、已用、总数  回 设备信息、手消液、白名单 
    BASE_INFO_API = '/receviceUpdate',
    // 20分钟循环发送 设备阈值
    LIMIT_API = '/receviceLimit',
    // 20分钟询问平台是否修改阈值 更新本地阈值
    QUERY_LIMIT_API = '/queryAlarmLimitAndroid',
    // 18分钟询问平台白名单下的可以存放的试管
    QUERY_WHITELIST_INFO_API = '/addInfo',
    // 放样本地无试管信息时 询问平台试管信息
    QUERY_SERVICE_INFO_API = '/selectInfo',
    // 护士码录本地数据库不存在 询问平台护士信息
    QUERY_SERVICE_NURSE_API = '/selectSerialNurse',

    // 上传试管信息
    ADD_PUT_INFO_API = '/addPut2',
    // 上传取样信息
    ADD_OUT_INFO_API = '/addOut2',

    // 添加医护
    ADD_NURSE_API = '/addNurse',
    // 删除医护
    DELETE_NURSE_API = '/deleteNurse',
    // 添加消毒记录
    ADD_DISINFECT_API = '/addDisinfectUse',
    // 添加报警记录
    ADD_ALARM_API = '/receiveAlarm',

    // 获取更新
    QUERY_VERSION_API = '/version'
}

// 20分钟循环发送 序列号、已用、总数
// 回 设备信息、手消液、白名单 
export const sendDeviceBaseInfoApi = (data: any) => post(API.BASE_INFO_API, data)

// 20分钟循环发送 设备阈值 总数 tubeCount、alarmCount、disinfectData、lockData 、alarmData 取样时间超时、serial
// 回 200
export const sendDeviceLimitApi = (data: any) => post(API.LIMIT_API, data)

// 20分钟询问平台是否修改阈值 
export const queryDeviceLimitApi = (data: any) => post(API.QUERY_LIMIT_API, data)

// 18分钟询问平台白名单下的可以存放的试管
export const queryWhitelistInfoApi = (data: any) => postWithQuery(API.QUERY_WHITELIST_INFO_API, data)

// 放样本地无试管信息时 询问平台试管信息
export const queryServiceInfoApi = (data: any) => postWithQuery(API.QUERY_SERVICE_INFO_API, data)

// 护士码录本地数据库不存在 询问平台护士信息
export const queryServiceNurseApi = (data: any) => post(API.QUERY_SERVICE_NURSE_API, data)


// 上传Tube信息
export const addPutsInfoApi = (data: any) => postWithQuery(API.ADD_PUT_INFO_API, data)
// 上传取样信息
export const addOutsInfoApi = (data: any) => postWithQuery(API.ADD_OUT_INFO_API, data)


// 上传放样
export const uploadPutsFileApi = (data: any) => upload(API.ADD_PUT_INFO_API, data)
// 上传取样
export const uploadOutsFileApi = (data: any) => upload(API.ADD_OUT_INFO_API, data)

// 添加医护
export const addNurseApi = (data: any) => post(API.ADD_NURSE_API, data)
// 删除医护
export const deleteNurseApi = (data: any) => post(API.DELETE_NURSE_API, data)
// 添加消毒记录
export const addDisinfectApi = (data: any) => post(API.ADD_DISINFECT_API, data)
// 添加报警记录
export const addAlarmApi = (data: any) => post(API.ADD_ALARM_API, data)
// 获取更新
export const getVersionApi = (data: any) => postWithQuery(API.QUERY_VERSION_API, data)
